home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / shadez.swf / scripts / Local / Game / Thing / CShotScud.as < prev    next >
Encoding:
Text File  |  2011-08-19  |  3.1 KB  |  110 lines

  1. package Local.Game.Thing
  2. {
  3.    import Local.Game.World.*;
  4.    import Local.Game.World.Map.*;
  5.    import Local.Game.World.Map.Cell.*;
  6.    import Local.Math.*;
  7.    import STC9.System.*;
  8.    import flash.display.*;
  9.    import flash.events.*;
  10.    import flash.geom.*;
  11.    
  12.    public class CShotScud extends CShot
  13.    {
  14.        
  15.       
  16.       private var mPath:CPath;
  17.       
  18.       private var mFlare:CThingAnimation;
  19.       
  20.       public function CShotScud(param1:CPosition, param2:CAngle, param3:*)
  21.       {
  22.          super(param1);
  23.          mType = "scud";
  24.          Process = Process_Normal;
  25.          mAngle = param2;
  26.          mAngle.InvertOrientation();
  27.          mMaxLife = mLife = 50;
  28.          mMaxSpeed = 100 * mSpriteScalar * mEnemySpeed;
  29.          mSpeed = 0;
  30.          mAcceleration = 1 * mEnemySpeed;
  31.          mOrientation = 1;
  32.          mShowOnMap = true;
  33.          mTargetAirbourne = true;
  34.          AddAnimation("stand",ScudMissile,"AddSprite_Black");
  35.          SetCollisionBySprite(mAnimation[0]);
  36.          AddThing(mFlare = new CThingAnimation(ScudMissile_Flare,"AddSprite_Scale"));
  37.          ┬º┬ºpush(┬º┬ºfindproperty(mTarget));
  38.          if(true)
  39.          {
  40.             ┬º┬ºpop().mTarget = param3 is CPosition ? param3 : param3.mPosition.Clone();
  41.             mPath = new CPath();
  42.             mPath.SetPath_PD2(mPosition,mAngle.mDelta,mTarget);
  43.             mPath.OrientateThing(this);
  44.             IncrementFired();
  45.             return;
  46.          }
  47.          ┬º┬ºgoto(addr92);
  48.       }
  49.       
  50.       override public function Draw() : void
  51.       {
  52.          var _loc1_:Matrix = null;
  53.          var _loc2_:Point = null;
  54.          if(true)
  55.          {
  56.             super.Draw();
  57.             DrawTrail(4,150);
  58.          }
  59.          _loc1_ = GetOrientationMatrix();
  60.          DrawSprite(_loc1_);
  61.          _loc2_ = _loc1_.transformPoint(mSprite.mObjects["flare"].mPosition);
  62.          if(true)
  63.          {
  64.             mFlare.mPosition.SetXY(_loc2_.x + mPosition.x,_loc2_.y + mPosition.y);
  65.             if(true)
  66.             {
  67.                mFlare.mAngle.Copy(mAngle);
  68.             }
  69.             mFlare.Draw();
  70.          }
  71.       }
  72.       
  73.       public function Process_Normal() : void
  74.       {
  75.          var _loc1_:Point = null;
  76.          Accelerate_Speed();
  77.          mPath.MoveAlong(mSpeed);
  78.          mPath.OrientateThing(this);
  79.          mCollide.Update();
  80.          if(MapMoveTrail())
  81.          {
  82.             Process_ReachedObjective();
  83.          }
  84.          Process_Children();
  85.          _loc1_ = OrientatePoint(mSprite.mObjects["payload"].mPosition.clone(),mPosition);
  86.          if(true)
  87.          {
  88.             if(_loc1_.y >= mLandscape.GetAltitude(_loc1_.x))
  89.             {
  90.                if(true)
  91.                {
  92.                   AddThing(new CEffectExplosionLarge(new CPosition(_loc1_.x,mLandscape.GetAltitude(_loc1_.x))));
  93.                   if(true)
  94.                   {
  95.                      mDead = true;
  96.                   }
  97.                   ┬º┬ºgoto(addr82);
  98.                }
  99.                DispatchDispose();
  100.             }
  101.             ┬º┬ºgoto(addr82);
  102.          }
  103.          addr82:
  104.          if(mDead)
  105.          {
  106.          }
  107.       }
  108.    }
  109. }
  110.